package com.hwl.demo4.service.impl;

import com.hwl.demo4.entity.SchoolGirl;
import com.hwl.demo4.service.IGiveGift;

/**
 * 代理类
 *
 * @author sentry
 * @since 2023-03-18
 */
public class Proxy implements IGiveGift {

    private final Pursuit gg; // 认识追求者

    public Proxy(SchoolGirl mm) { // 也认识被追求者
        this.gg = new Pursuit(mm); // 代理初始化的过程，实际是追求者初始化的过程
    }

    @Override
    public void giveDolls() {
        this.gg.giveDolls(); // 代理在送礼物，实际是追求者在送礼物
    }

    @Override
    public void giveFlowers() {
        this.gg.giveFlowers();
    }

    @Override
    public void giveChocolate() {
        this.gg.giveFlowers();
    }
}
